﻿package src.game.managers {
	import src.game.Letter;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	public class ObjectProperties {
		private var speed:int;
		private var rotationSpeed:Number = 0;
		private var area:Rectangle;
		
		public function ObjectProperties(area:Rectangle) {
			this.area = area;
		}
		
		public function setProperties(element:Letter):Letter {
			element.setSpeed(speed);
			trace ("are post " + area.x + "," + area.y);
			trace ("range " + area.width + "," + area.height);
			element.x = area.x + (int)(Math.random() * ((area.width - area.x) + 1));
			element.y = area.y + (int)(Math.random() * ((area.height - area.y) + 1));
			element.setRotationSpeed(( (Math.random() * 2) - 1) * rotationSpeed);
			trace ("element " + element.content + " " + element.x + "," + element.y);
			return element;
		}
		
		public function setSpeed(speed:int):void {
			this.speed = speed;
		}
		
		public function setRotation(rotationSpeed:int):void {
			this.rotationSpeed =  rotationSpeed;
		}
		
		public function setArea(area:Rectangle):void {
			this.area = area;
		}
	}
}
